import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from "../views/Login";
import Index from "../views/Index";
import Role from "../views/Role";
import Functions from "../views/Functions";
import User from "../views/User";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Login',
    component: Login
  },
  {
    path: '/index',
    name: 'Index',
    component: Index,
    children:[
      {
        path: '/role',
        name: 'Role',
        component: Role
      },
      {
        path: '/functions',
        name: 'Functions',
        component: Functions
      },
      {
        path: '/user',
        name: 'User',
        component: User
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
